]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Add and export shell_global_get_primary_monitor_index
authorAlexander Larsson <alexl@redhat.com>
Mon, 28 Feb 2011 19:06:58 +0000 (20:06 +0100)
committerAlexander Larsson <alexl@redhat.com>
Wed, 16 Mar 2011 19:33:25 +0000 (20:33 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=609258

src/shell-global.c
src/shell-global.h

index 2d55033fa53aef0eebcdadc03677a8a58e40bbdf..32836cba5070b022889cadccae579c797a7e15a9 100644 (file)
@@ -1410,6 +1410,23 @@ shell_global_get_primary_monitor (ShellGlobal  *global)
   return meta_rectangle_copy (&rect);
 }
 
+/**
+ * shell_global_get_primary_monitor_index:
+ * @global: the #ShellGlobal
+ *
+ * Gets the index of the primary monitor (the one that the
+ * panel is on).
+ *
+ * Return value: the index of the primary monitor
+ */
+int
+shell_global_get_primary_monitor_index (ShellGlobal  *global)
+{
+  MetaScreen *screen = shell_global_get_screen (global);
+
+  return meta_screen_get_primary_monitor (screen);
+}
+
 /**
  * shell_global_get_focus_monitor:
  * @global: the #ShellGlobal
index f05391915e7b3114cc15c365520748a22c00f0d4..40f9a8f9bacef5dcd4d253f8f618d71cb30a9c4d 100644 (file)
@@ -100,6 +100,7 @@ void shell_global_format_time_relative_pretty (ShellGlobal *global, guint delta,
 
 GSList       *shell_global_get_monitors        (ShellGlobal  *global);
 MetaRectangle *shell_global_get_primary_monitor (ShellGlobal  *global);
+int            shell_global_get_primary_monitor_index (ShellGlobal  *global);
 MetaRectangle *shell_global_get_focus_monitor   (ShellGlobal  *global);
 
 void shell_global_get_pointer (ShellGlobal         *global,